package com.project.systemfront.service.impl;

import com.project.systemfront.mapper.ForUserMapper;
import com.project.systemfront.pojo.ForUser;
import com.project.systemfront.service.IForUserService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * 用户Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-20
 */
@Service
public class ForUserServiceImpl implements IForUserService
{
    @Autowired
    private ForUserMapper forUserMapper;


    @Override
    public ForUser selectForUserById(Long id) {
        return forUserMapper.selectForUserById(id);
    }

    /**
     * 新增用户
     * 
     * @param forUser 用户
     * @return 结果
     */
    @Override
    public int insertForUser(ForUser forUser)
    {
        forUser.setCreateTime(new Date());
        return forUserMapper.insertForUser(forUser);
    }

    /**
     * 修改用户
     * 
     * @param forUser 用户
     * @return 结果
     */
    @Override
    public int updateForUser(ForUser forUser)
    {
        forUser.setUpdateTime(new Date());
        return forUserMapper.updateForUser(forUser);
    }

    @Override
    public ForUser findByUserName(String username) {
        return forUserMapper.findByUserName(username);
    }


}
